using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SysFrame.Message;
using System.Reflection;

namespace SysFrame.BP
{
    /// <summary>
    /// system_r3方法
    /// </summary>
    public class BLLsystem_r3
    {
        public Isystem_r3 interface_system_r3;

        public BLLsystem_r3()
        {
            object obj = BPBase.GetAchieve("SysFrame.BP","system_r3");
            interface_system_r3 = (Isystem_r3)obj;
        }


        /// <summary>
        /// 得到system_r3实体
        /// </summary>
        /// <param name="msq">条件</param>
        /// <returns></returns>
        public List<Mssystem_r3> Getsystem_r3MsByQuery(MsQuery msq)
        {
            return interface_system_r3.Getsystem_r3MsByQuery(msq);
        }

        /// <summary>
        /// 通过System_R3_10得到实体
        /// </summary>
        /// <param name="System_R3_10">ID</param>
        /// <returns>实体</returns>
        public Mssystem_r3 Getsystem_r3MsByKey(string System_R3_10)
        {
            MsQuery msquery = new MsQuery();
            msquery.strquery += " and System_R3_10='" + System_R3_10 + "' ";
            List<Mssystem_r3> lstData = Getsystem_r3MsByQuery(msquery);
            return lstData[0];
        }

        /// <summary>
        ///  保存system_r3信息
        /// </summary>
        /// <param name="ms">实体信息</param>
        /// <returns>消息</returns>
        public MsReturned Savesystem_r3(Mssystem_r3 ms)
        {
            return interface_system_r3.Savesystem_r3(ms);
        }

        /// <summary>
        /// 得到数据类型
        /// </summary>
        /// <param name="msquery">条件</param>
        /// <returns>数据类型</returns>
        public MsReturned Getsystem_r3ByQuery(MsQuery msquery)
        {
            return interface_system_r3.Getsystem_r3ByQuery(msquery);
        }

        /// <summary>
        /// 删除system_r3
        /// </summary>
        /// <param name="msq">条件</param>
        /// <returns></returns>
        public MsReturned Deletesystem_r3ByQuery(MsQuery msq)
        {
            return interface_system_r3.Deletesystem_r3ByQuery(msq);
        }
        /// <summary>
        /// 删除system_r3
        /// </summary>
        /// <param name="msq">条件</param>
        /// <returns></returns>
        public MsReturned Deletesystem_r3ByKey(string System_R3_10)
        {
            MsQuery msquery = new MsQuery();
            
             if (System_R3_10.IndexOf(",") > 0)
            {
                msquery.strquery += " and System_R3_10 in (" + System_R3_10 + ") ";
            }
            else
            {
                msquery.strquery += " and System_R3_10='" + System_R3_10 + "' ";
            }
            return interface_system_r3.Deletesystem_r3ByQuery(msquery);
        }
    }
}
